home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / nar.bst < prev    next >
Text File  |  1992-07-19  |  21KB  |  1,057 lines

  1. %%% ====================================================================
  2. %%%  @BibTeX-style-file{
  3. %%%     author          = "Tom Schneider",
  4. %%%     version         = "3.04",
  5. %%%     date            = "10 Sep 1991",
  6. %%%     filename        = "nar.bst",
  7. %%%     address         = "National Cancer Institute
  8. %%%                        Laboratory of Mathematical Biology
  9. %%%                        Frederick, Maryland 21701-1013
  10. %%%                        USA",
  11. %%%     checksum        = "49904 1056 2955 21359",
  12. %%%     email           = "toms@ncifcrf.gov (Internet)",
  13. %%%     codetable       = "ISO/ASCII",
  14. %%%     keywords        = "nucleic acid research",
  15. %%%     supported       = "yes",
  16. %%%     docstring       = "This BibTeX bibliography style is for the
  17. %%%                        journal Nucleic Acid Research.  It was
  18. %%%                        adapted from the standard unsrt.bst style
  19. %%%                        file.
  20. %%%
  21. %%%                        The checksum field above contains a CRC-16
  22. %%%                        checksum as the first value, followed by the
  23. %%%                        equivalent of the standard UNIX wc (word
  24. %%%                        count) utility output of lines, words, and
  25. %%%                        characters.  This is produced by Robert
  26. %%%                        Solovay's checksum utility."
  27. %%%  }
  28. %%% ====================================================================
  29.  
  30. % new.bst
  31. % nar.bst was created by Tom Schneider from unsrt.bst
  32. % version = 3.04 of nar.bst 1990 May 23
  33. %  Tom Schneider
  34. %  National Cancer Institute
  35. %  Laboratory of Mathematical Biology
  36. %  Frederick, Maryland
  37. %  toms@ncifcrf.gov
  38.  
  39. % BibTeX standard bibliography style `unsrt'
  40.     % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  41.     % Copyright (C) 1985, all rights reserved.
  42.     % Copying of this file is authorized only if either
  43.     % (1) you make absolutely no changes to your copy, including name, or
  44.     % (2) if you do make changes, you name it something other than
  45.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  46.     % This restriction helps ensure that all standard styles are identical.
  47.     % The file btxbst.doc has the documentation for this style.
  48.  
  49. ENTRY
  50.   { address
  51.     author
  52.     booktitle
  53.     chapter
  54.     edition
  55.     editor
  56.     howpublished
  57.     institution
  58.     journal
  59.     key
  60.     month
  61.     note
  62.     number
  63.     organization
  64.     pages
  65.     publisher
  66.     school
  67.     series
  68.     title
  69.     type
  70.     volume
  71.     year
  72.   }
  73.   {}
  74.   { label }
  75.  
  76. INTEGERS { output.state before.all mid.sentence after.sentence after.block
  77.            doblank straightnames}
  78.  
  79. FUNCTION {init.state.consts}
  80. { #0 'before.all :=
  81.   #1 'mid.sentence :=
  82.   #2 'after.sentence :=
  83.   #3 'after.block :=
  84.  
  85.   #0 'doblank := % put a blanks in output.nonnul if not zero
  86.   #0 'straightnames := % force names to be J. B. Smith if not zero
  87.                        % otherwise they are Smith, J. B.
  88. }
  89.  
  90. STRINGS { s t }
  91.  
  92. FUNCTION {between}
  93. { % what to do between output items TDS (AVOID COMMAS)
  94.    doblank #0 =
  95.    {" " * write$}
  96.    {write$}
  97.    if$
  98. }
  99.  
  100. FUNCTION {output.nonnull}
  101. { 's :=
  102.   output.state mid.sentence =
  103. %    { ", " * write$ } % TDS NO COMMAS!!!
  104.     {
  105.      between
  106.     }
  107.  
  108.     { output.state after.block =
  109.     {
  110. %         add.period$ write$ % TDS NO PERIODS!
  111.           write$ % TDS NO PERIODS!
  112.       newline$
  113. %      "\newblock " write$ % TDS NO NEWBLOCKS: makes for a cleaner file
  114.     }
  115.     { output.state before.all =
  116.         'write$
  117. %        { add.period$ " " * write$ } % TDS NO PERIODS!!!
  118. %        { " " * write$ } % TDS NO PERIODS!!!
  119.             {between}
  120.       if$
  121.     }
  122.       if$
  123.       mid.sentence 'output.state :=
  124.     }
  125.   if$
  126.   s
  127. }
  128.  
  129. FUNCTION {output}
  130. { duplicate$ empty$
  131.     'pop$
  132.     'output.nonnull
  133.   if$
  134. }
  135.  
  136. FUNCTION {output.check}
  137. { 't :=
  138.   duplicate$ empty$
  139.     { pop$ "empty " t * " in " * cite$ * warning$ }
  140.     'output.nonnull
  141.   if$
  142. }
  143.  
  144. FUNCTION {output.bibitem}
  145. { newline$
  146.   "\bibitem{" write$
  147.   cite$ write$
  148.   "}" write$
  149.   newline$
  150.   ""
  151.   before.all 'output.state :=
  152. }
  153.  
  154. FUNCTION {fin.entry}
  155. { add.period$
  156.   write$
  157.   newline$
  158. }
  159.  
  160. FUNCTION {new.block}
  161. { output.state before.all =
  162.     'skip$
  163.     { after.block 'output.state := }
  164.   if$
  165. }
  166.  
  167. FUNCTION {new.sentence}
  168. { output.state after.block =
  169.     'skip$
  170.     { output.state before.all =
  171.     'skip$
  172.     { after.sentence 'output.state := }
  173.       if$
  174.     }
  175.   if$
  176. }
  177.  
  178. FUNCTION {not}
  179. {   { #0 }
  180.     { #1 }
  181.   if$
  182. }
  183.  
  184. FUNCTION {and}
  185. {   'skip$
  186.     { pop$ #0 }
  187.   if$
  188. }
  189.  
  190. FUNCTION {or}
  191. {   { pop$ #1 }
  192.     'skip$
  193.   if$
  194. }
  195.  
  196. FUNCTION {new.block.checka}
  197. { empty$
  198.     'skip$
  199.     'new.block
  200.   if$
  201. }
  202.  
  203. FUNCTION {new.block.checkb}
  204. { empty$
  205.   swap$ empty$
  206.   and
  207.     'skip$
  208.     'new.block
  209.   if$
  210. }
  211.  
  212. FUNCTION {new.sentence.checka}
  213. { empty$
  214.     'skip$
  215.     'new.sentence
  216.   if$
  217. }
  218.  
  219. FUNCTION {new.sentence.checkb}
  220. { empty$
  221.   swap$ empty$
  222.   and
  223.     'skip$
  224.     'new.sentence
  225.   if$
  226. }
  227.  
  228. FUNCTION {field.or.null}
  229. { duplicate$ empty$
  230.     { pop$ "" }
  231.     'skip$
  232.   if$
  233. }
  234.  
  235. FUNCTION {emphasize}
  236. { duplicate$ empty$
  237.     { pop$ "" }
  238.     { "{\em " swap$ * "}" * }
  239.   if$
  240. }
  241.  
  242. INTEGERS { nameptr namesleft numnames }
  243.  
  244. FUNCTION {format.names}
  245. { 's :=
  246.   #1 'nameptr :=
  247.   s num.names$ 'numnames :=
  248.   numnames 'namesleft :=
  249.     { namesleft #0 > }
  250.     {
  251. % the original format line: makes "J. D. Smith". TDS
  252. %   s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := % TDS old formatting
  253. % the new format line: makes "Smith, J. D.". TDS
  254. %   s nameptr "{vv}{ll}{, jj}{, f.}" format.name$ 't := % TDS new formatting
  255. % note, no ~ so that the format is straight for NAR.
  256.  
  257.    straightnames #0 =
  258.    { s nameptr "{vv}{ll}{, jj}{, f.}" format.name$ 't := }% TDS
  259.    { s nameptr "{ff{ }}{vv}{ ll}{, jj}" format.name$ 't := }% TDS
  260.    if$
  261.  
  262.       nameptr #1 >
  263.     { namesleft #1 >
  264.         { ", " * t * }
  265.         { numnames #2 >
  266.         { "," * }
  267.         'skip$
  268.           if$
  269.           t "others" =
  270. %        { " et~al." * } % TDS
  271.         { " et al." * } % TDS no ~
  272.         { " and " * t * }
  273.           if$
  274.         }
  275.       if$
  276.     }
  277.     't
  278.       if$
  279.       nameptr #1 + 'nameptr :=
  280.       namesleft #1 - 'namesleft :=
  281.     }
  282.   while$
  283. }
  284.  
  285. FUNCTION {format.authors}
  286. { author empty$
  287.     { "" }
  288.     { author format.names }
  289.   if$
  290. }
  291.  
  292. FUNCTION {format.editors}
  293. {
  294.  #1 'straightnames := % names go as J. B. Smith for editors
  295.  editor empty$
  296.     { "" }
  297.     { editor format.names
  298.       editor num.names$ #1 >
  299.     { ", (ed.)" * }
  300.     { ", (ed.)" * }
  301. %    { ", editors" * }
  302. %    { ", editor" * }
  303.       if$
  304.     }
  305.   if$
  306.  #0 'straightnames := % names go as Smith, J. B. again
  307. }
  308.  
  309. FUNCTION {format.title}
  310. { title empty$
  311.     { "" }
  312.     { title "t" change.case$ }
  313.   if$
  314. }
  315.  
  316. FUNCTION {n.dashify}
  317. { 't :=
  318.   ""
  319.     { t empty$ not }
  320.     { t #1 #1 substring$ "-" =
  321.     { t #1 #2 substring$ "--" = not
  322.         { "--" *
  323.           t #2 global.max$ substring$ 't :=
  324.         }
  325.         {   { t #1 #1 substring$ "-" = }
  326.         { "-" *
  327.           t #2 global.max$ substring$ 't :=
  328.         }
  329.           while$
  330.         }
  331.       if$
  332.     }
  333.     { t #1 #1 substring$ *
  334.       t #2 global.max$ substring$ 't :=
  335.     }
  336.       if$
  337.     }
  338.   while$
  339. }
  340.  
  341. FUNCTION {format.date}
  342. { year empty$
  343.     { month empty$
  344.     { "" }
  345.     { "there's a month but no year in " cite$ * warning$
  346.       month
  347.     }
  348.       if$
  349.     }
  350.     { month empty$
  351. %    'year originally
  352.     {"(" year ")" * * } % TDS
  353.     { month " " * year * }
  354.       if$
  355.     }
  356.   if$
  357. }
  358.  
  359. FUNCTION {format.btitle}
  360. { title %emphasize not for NAR! TDS
  361. }
  362.  
  363. FUNCTION {tie.or.space.connect}
  364. { duplicate$ text.length$ #3 <
  365.     { "~" }
  366.     { " " }
  367.   if$
  368.   swap$ * *
  369. }
  370.  
  371. FUNCTION {either.or.check}
  372. { empty$
  373.     'pop$
  374.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  375.   if$
  376. }
  377.  
  378. FUNCTION {format.bvolume}
  379. { volume empty$
  380.     { "" }
  381. %    { "volume" volume tie.or.space.connect % TDS
  382.     { "volume" "{\bf " volume "}, " * * tie.or.space.connect
  383.     % TDS add a comma and bold
  384.       series empty$
  385.     'skip$
  386.     %{ " of " * series emphasize * } TDS
  387.     { " of " * series  } % TDS book titles not emphasized for NAR
  388.       if$
  389.       "volume and number" number either.or.check
  390.     }
  391.   if$
  392. }
  393.  
  394. FUNCTION {format.number.series}
  395. { volume empty$
  396.     { number empty$
  397.     { series field.or.null }
  398.     { output.state mid.sentence =
  399.         { "number" }
  400.         { "Number" }
  401.       if$
  402.       number tie.or.space.connect
  403.       series empty$
  404.         { "there's a number but no series in " cite$ * warning$ }
  405.         { " in " * series * }
  406.       if$
  407.     }
  408.       if$
  409.     }
  410.     { "" }
  411.   if$
  412. }
  413.  
  414. FUNCTION {format.edition}
  415. { edition empty$
  416.     { "" }
  417.     { output.state mid.sentence =
  418.     { " " edition * "l" change.case$ " edition" * } % TDS add space before
  419.     { " " edition * "t" change.case$ " edition" * } % TDS add space before
  420.       if$
  421.     }
  422.   if$
  423. }
  424.  
  425. INTEGERS { multiresult }
  426.  
  427. FUNCTION {multi.page.check}
  428. { 't :=
  429.   #0 'multiresult :=
  430.     { multiresult not
  431.       t empty$ not
  432.       and
  433.     }
  434.     { t #1 #1 substring$
  435.       duplicate$ "-" =
  436.       swap$ duplicate$ "," =
  437.       swap$ "+" =
  438.       or or
  439.     { #1 'multiresult := }
  440.     { t #2 global.max$ substring$ 't := }
  441.       if$
  442.     }
  443.   while$
  444.   multiresult
  445. }
  446.  
  447. FUNCTION {format.pages}
  448. { pages empty$
  449.     { "" }
  450.     { pages multi.page.check
  451. %    { "pages" pages n.dashify tie.or.space.connect } % TDS
  452. %    { "page" pages tie.or.space.connect } % TDS
  453.     { "pp." pages n.dashify tie.or.space.connect } % TDS
  454.     { "p." pages tie.or.space.connect } % TDS
  455.       if$
  456.     }
  457.   if$
  458. }
  459.  
  460. FUNCTION {format.vol.num.pages}
  461. %{ volume * field.or.null
  462. { "{\bf " volume * field.or.null % TDS add boldface
  463.   number empty$
  464.     'skip$
  465.     { "(" number * ")" * *
  466.       volume empty$
  467.     { "there's a number but no volume in " cite$ * warning$ }
  468.     'skip$
  469.       if$
  470.     }
  471.   if$
  472.   pages empty$
  473.     'skip$
  474.     { duplicate$ empty$
  475.     { pop$ format.pages }
  476. %    { ":" * pages n.dashify * } % TDS remove colon!
  477.     { "}, " * pages n.dashify * } % TDS replace colon with a comma
  478.         % TDS add a boldface
  479.       if$
  480.     }
  481.   if$
  482. }
  483.  
  484. FUNCTION {format.chapter.pages}
  485. { chapter empty$
  486.     'format.pages
  487.     { type empty$
  488.     { "chapter" }
  489.     { type "l" change.case$ }
  490.       if$
  491.       chapter tie.or.space.connect
  492.       pages empty$
  493.     'skip$
  494.     { ", " * format.pages * }
  495.       if$
  496.     }
  497.   if$
  498. }
  499.  
  500. FUNCTION {format.in.ed.booktitle}
  501. { booktitle empty$
  502.     { "" }
  503.     { editor empty$
  504.         % add colon after "In"
  505.     %{ "In " booktitle emphasize * } % TDS
  506.     %{ "In " format.editors * ", " * booktitle emphasize *
  507.     { "In " booktitle *} % TDS no emphasis in nar!
  508.     { "In " format.editors * ", " * booktitle * % TDS no emphasis in nar!
  509.            ", " * } % TDS and tack on a comma
  510.       if$
  511.     }
  512.   if$
  513. }
  514.  
  515. FUNCTION {empty.misc.check}
  516. { author empty$ title empty$ howpublished empty$
  517.   month empty$ year empty$ note empty$
  518.   and and and and and
  519.     { "all relevant fields are empty in " cite$ * warning$ }
  520.     'skip$
  521.   if$
  522. }
  523.  
  524. FUNCTION {format.thesis.type}
  525. { type empty$
  526.     'skip$
  527.     { pop$
  528.       type "t" change.case$
  529.     }
  530.   if$
  531. }
  532.  
  533. FUNCTION {format.tr.number}
  534. { type empty$
  535.     { "Technical Report" }
  536.     'type
  537.   if$
  538.   number empty$
  539.     { "t" change.case$ }
  540.     { number tie.or.space.connect }
  541.   if$
  542. }
  543.  
  544. FUNCTION {format.article.crossref}
  545. { key empty$
  546.     { journal empty$
  547.     { "need key or journal for " cite$ * " to crossref " * crossref *
  548.       warning$
  549.       ""
  550.     }
  551.     { "In {\em " journal * "\/}" * } % TDS
  552.       if$
  553.     }
  554.     { "In " key * } % TDS
  555.   if$
  556.   " \cite{" * crossref * "}" *
  557. }
  558.  
  559. FUNCTION {format.crossref.editor}
  560. { editor #1 "{vv~}{ll}" format.name$
  561.   editor num.names$ duplicate$
  562.   #2 >
  563.     { pop$ " et~al." * }
  564.     { #2 <
  565.     'skip$
  566.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  567.         { " et~al." * }
  568.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  569.       if$
  570.     }
  571.       if$
  572.     }
  573.   if$
  574. }
  575.  
  576. FUNCTION {format.book.crossref}
  577. { volume empty$
  578.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  579.       "In " % TDS
  580.     }
  581.     { "Volume" volume tie.or.space.connect
  582.       " of " *
  583.     }
  584.   if$
  585.   editor empty$
  586.   editor field.or.null author field.or.null =
  587.   or
  588.     { key empty$
  589.     { series empty$
  590.         { "need editor, key, or series for " cite$ * " to crossref " *
  591.           crossref * warning$
  592.           "" *
  593.         }
  594.         { "{\em " * series * "\/}" * }
  595.       if$
  596.     }
  597.     { key * }
  598.       if$
  599.     }
  600.     { format.crossref.editor * }
  601.   if$
  602.   " \cite{" * crossref * "}" *
  603. }
  604.  
  605. FUNCTION {format.incoll.inproc.crossref}
  606. { editor empty$
  607.   editor field.or.null author field.or.null =
  608.   or
  609.     { key empty$
  610.     { booktitle empty$
  611.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  612.           crossref * warning$
  613.           ""
  614.         }
  615.         { "In " booktitle * } % TDS
  616.       if$
  617.     }
  618.     { "In " key * } % TDS
  619.       if$
  620.     }
  621.     { "In " format.crossref.editor * } % TDS
  622.   if$
  623.   " \cite{" * crossref * "}" *
  624. }
  625.  
  626. FUNCTION {article}
  627. { output.bibitem
  628.   format.authors "author" output.check
  629.   format.date "year" output.check % TDS move date to here
  630.   new.block
  631. %  format.title "title" output.check % TDS NO TITLES
  632. %  new.block
  633.   crossref missing$
  634.     { journal emphasize "journal" output.check
  635.       format.vol.num.pages output
  636. %      format.date "year" output.check % TDS move date
  637.     }
  638.     { format.article.crossref output.nonnull
  639.       format.pages output
  640.     }
  641.   if$
  642.   new.block
  643.   note output
  644.   fin.entry
  645. }
  646.  
  647. FUNCTION {book}
  648. { output.bibitem
  649.   author empty$
  650.     { format.editors "author and editor" output.check }
  651.     { format.authors output.nonnull
  652.       crossref missing$
  653.     { "author and editor" editor either.or.check }
  654.     'skip$
  655.       if$
  656.     }
  657.   if$
  658.  
  659.   format.date "year" output.check % TDS new location
  660.   new.block
  661.   #1 'doblank := % remove blanks TDS
  662.   format.btitle "title" output.check
  663.   ", " output % give it a comma after the title TDS
  664.   crossref missing$
  665.     { format.bvolume output
  666.       new.block
  667.       format.number.series output
  668.       new.sentence
  669.       publisher "publisher" output.check
  670.       ", " output % give it a comma after the publisher TDS
  671.       address output
  672.     }
  673.     { new.block
  674.       format.book.crossref output.nonnull
  675.     }
  676.   if$
  677.   format.edition output
  678. %  format.date "year" output.check % TDS former location
  679.   new.block
  680.   note output
  681.   fin.entry
  682.   #0 'doblank := % blanks again TDS
  683. }
  684.  
  685. FUNCTION {booklet}
  686. { output.bibitem
  687.   format.authors output
  688.   new.block
  689.   format.title "title" output.check
  690.   howpublished address new.block.checkb
  691.   howpublished output
  692.   address output
  693.   format.date output
  694.   new.block
  695.   note output
  696.   fin.entry
  697. }
  698.  
  699. FUNCTION {inbook}
  700. { output.bibitem
  701.   author empty$
  702.     { format.editors "author and editor" output.check }
  703.     { format.authors output.nonnull
  704.       crossref missing$
  705.     { "author and editor" editor either.or.check }
  706.     'skip$
  707.       if$
  708.     }
  709.   if$
  710.   new.block
  711.   format.btitle "title" output.check
  712.   crossref missing$
  713.     { format.bvolume output
  714.       format.chapter.pages "chapter and pages" output.check
  715.       new.block
  716.       format.number.series output
  717.       new.sentence
  718.       publisher "publisher" output.check
  719.       address output
  720.     }
  721.     { format.chapter.pages "chapter and pages" output.check
  722.       new.block
  723.       format.book.crossref output.nonnull
  724.     }
  725.   if$
  726.   format.edition output
  727.   format.date "year" output.check
  728.   new.block
  729.   note output
  730.   fin.entry
  731. }
  732.  
  733. FUNCTION {incollection}
  734. { output.bibitem
  735.   format.authors "author" output.check
  736.   format.date "year" output.check % TDS
  737.   new.block
  738.   format.title "title" output.check
  739.   new.block
  740.   crossref missing$
  741.     { format.in.ed.booktitle "booktitle" output.check
  742.       format.bvolume output
  743.       format.number.series output
  744.       format.chapter.pages output
  745.       new.sentence
  746.       publisher "publisher" output.check
  747.       address output
  748.       format.edition output
  749. %      format.date "year" output.check % TDS
  750.     }
  751.     { format.incoll.inproc.crossref output.nonnull
  752.       format.chapter.pages output
  753.     }
  754.   if$
  755.   new.block
  756.   note output
  757.   fin.entry
  758. }
  759.  
  760. FUNCTION {inproceedings}
  761. { output.bibitem
  762.   format.authors "author" output.check
  763.   format.date "year" output.check % TDS
  764.   new.block
  765. %  format.title "title" output.check % TDS NO TITLE
  766. %  new.block
  767.   crossref missing$
  768.     { format.in.ed.booktitle "booktitle" output.check
  769.       format.bvolume output
  770.       format.number.series output
  771. %      format.pages output % TDS pages go at the end
  772.       address empty$
  773.     { organization publisher new.sentence.checkb
  774.       organization output
  775.       ": "  output % TDS put a colon
  776.       publisher output
  777. %      format.date "year" output.check
  778.     }
  779.     { address output.nonnull
  780. %      format.date "year" output.check
  781.       new.sentence
  782.           #1 'doblank := % remove blanks
  783.       organization output
  784.       ": "  output % TDS put a colon after the location
  785. %zzz
  786.       publisher output
  787.       ". "  output % TDS put a period after the publisher
  788.           #0 'doblank := % put back blanks
  789.     }
  790.       if$
  791.     }
  792.     { format.incoll.inproc.crossref output.nonnull
  793. %      format.pages output % TDS pages go at the end
  794.     }
  795.   if$
  796.   new.block
  797.   note output
  798.   format.pages output % TDS pages go at the end
  799.   fin.entry
  800. }
  801.  
  802. FUNCTION {conference} { inproceedings }
  803.  
  804. FUNCTION {manual}
  805. { output.bibitem
  806.   author empty$
  807.     { organization empty$
  808.     'skip$
  809.     { organization output.nonnull
  810.       address output
  811.     }
  812.       if$
  813.     }
  814.     { format.authors output.nonnull }
  815.   if$
  816.   new.block
  817.   format.btitle "title" output.check
  818.   author empty$
  819.     { organization empty$
  820.     { address new.block.checka
  821.       address output
  822.     }
  823.     'skip$
  824.       if$
  825.     }
  826.     { organization address new.block.checkb
  827.       organization output
  828.       address output
  829.     }
  830.   if$
  831.   format.edition output
  832.   format.date output
  833.   new.block
  834.   note output
  835.   fin.entry
  836. }
  837.  
  838. FUNCTION {mastersthesis}
  839. { output.bibitem
  840.   format.authors "author" output.check
  841.   new.block
  842.   format.title "title" output.check
  843.   new.block
  844.   "Master's thesis" format.thesis.type output.nonnull
  845.   school "school" output.check
  846.   address output
  847.   format.date "year" output.check
  848.   new.block
  849.   note output
  850.   fin.entry
  851. }
  852.  
  853. FUNCTION {misc}
  854. { output.bibitem
  855.   format.authors output
  856.   title howpublished new.block.checkb
  857.   format.title output
  858.   howpublished new.block.checka
  859.   howpublished output
  860.   format.date output
  861.   new.block
  862.   note output
  863.   fin.entry
  864.   empty.misc.check
  865. }
  866.  
  867. FUNCTION {phdthesis}
  868. { output.bibitem
  869.   format.authors "author" output.check
  870.   new.block
  871.   format.btitle "title" output.check
  872.   new.block
  873.   "PhD thesis" format.thesis.type output.nonnull
  874.   school "school" output.check
  875.   address output
  876.   format.date "year" output.check
  877.   new.block
  878.   note output
  879.   fin.entry
  880. }
  881.  
  882. FUNCTION {proceedings}
  883. { output.bibitem
  884.   editor empty$
  885.     { organization output }
  886.     { format.editors output.nonnull }
  887.   if$
  888.   new.block
  889.   format.btitle "title" output.check
  890.   format.bvolume output
  891.   format.number.series output
  892.   address empty$
  893.     { editor empty$
  894.     { publisher new.sentence.checka }
  895.     { organization publisher new.sentence.checkb
  896.       organization output
  897.     }
  898.       if$
  899.       publisher output
  900.       format.date "year" output.check
  901.     }
  902.     { address output.nonnull
  903.       format.date "year" output.check
  904.       new.sentence
  905.       editor empty$
  906.     'skip$
  907.     { organization output }
  908.       if$
  909.       publisher output
  910.     }
  911.   if$
  912.   new.block
  913.   note output
  914.   fin.entry
  915. }
  916.  
  917. FUNCTION {techreport}
  918. { output.bibitem
  919.   format.authors "author" output.check
  920.   new.block
  921.   format.title "title" output.check
  922.   new.block
  923.   format.tr.number output.nonnull
  924.   institution "institution" output.check
  925.   address output
  926.   format.date "year" output.check
  927.   new.block
  928.   note output
  929.   fin.entry
  930. }
  931.  
  932. FUNCTION {unpublished}
  933. { output.bibitem
  934.   format.authors "author" output.check
  935.   new.block
  936.   format.title "title" output.check
  937.   new.block
  938.   note "note" output.check
  939.   format.date output
  940.   fin.entry
  941. }
  942.  
  943. FUNCTION {default.type} { misc }
  944.  
  945. MACRO {jan} {"January"}
  946.  
  947. MACRO {feb} {"February"}
  948.  
  949. MACRO {mar} {"March"}
  950.  
  951. MACRO {apr} {"April"}
  952.  
  953. MACRO {may} {"May"}
  954.  
  955. MACRO {jun} {"June"}
  956.  
  957. MACRO {jul} {"July"}
  958.  
  959. MACRO {aug} {"August"}
  960.  
  961. MACRO {sep} {"September"}
  962.  
  963. MACRO {oct} {"October"}
  964.  
  965. MACRO {nov} {"November"}
  966.  
  967. MACRO {dec} {"December"}
  968.  
  969. MACRO {acmcs} {"ACM Computing Surveys"}
  970.  
  971. MACRO {acta} {"Acta Informatica"}
  972.  
  973. MACRO {cacm} {"Communications of the ACM"}
  974.  
  975. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  976.  
  977. MACRO {ibmsj} {"IBM Systems Journal"}
  978.  
  979. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  980.  
  981. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  982.  
  983. MACRO {ieeetcad}
  984.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  985.  
  986. MACRO {ipl} {"Information Processing Letters"}
  987.  
  988. MACRO {jacm} {"Journal of the ACM"}
  989.  
  990. MACRO {jcss} {"Journal of Computer and System Sciences"}
  991.  
  992. MACRO {scp} {"Science of Computer Programming"}
  993.  
  994. MACRO {sicomp} {"SIAM Journal on Computing"}
  995.  
  996. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  997.  
  998. MACRO {tods} {"ACM Transactions on Database Systems"}
  999.  
  1000. MACRO {tog} {"ACM Transactions on Graphics"}
  1001.  
  1002. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  1003.  
  1004. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  1005.  
  1006. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  1007.  
  1008. MACRO {tcs} {"Theoretical Computer Science"}
  1009.  
  1010. READ
  1011.  
  1012. STRINGS { longest.label }
  1013.  
  1014. INTEGERS { number.label longest.label.width }
  1015.  
  1016. FUNCTION {initialize.longest.label}
  1017. { "" 'longest.label :=
  1018.   #1 'number.label :=
  1019.   #0 'longest.label.width :=
  1020. }
  1021.  
  1022. FUNCTION {longest.label.pass}
  1023. { number.label int.to.str$ 'label :=
  1024.   number.label #1 + 'number.label :=
  1025.   label width$ longest.label.width >
  1026.     { label 'longest.label :=
  1027.       label width$ 'longest.label.width :=
  1028.     }
  1029.     'skip$
  1030.   if$
  1031. }
  1032.  
  1033. EXECUTE {initialize.longest.label}
  1034.  
  1035. ITERATE {longest.label.pass}
  1036.  
  1037. FUNCTION {begin.bib}
  1038. { preamble$ empty$
  1039.     'skip$
  1040.     { preamble$ write$ newline$ }
  1041.   if$
  1042.   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  1043. }
  1044.  
  1045. EXECUTE {begin.bib}
  1046.  
  1047. EXECUTE {init.state.consts}
  1048.  
  1049. ITERATE {call.type$}
  1050.  
  1051. FUNCTION {end.bib}
  1052. { newline$
  1053.   "\end{thebibliography}" write$ newline$
  1054. }
  1055.  
  1056. EXECUTE {end.bib}
  1057.